import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Register from '../views/register.vue'
import Home from '../views/HomeView.vue'
import Users from '../views/houtai/Users.vue'
import Img from '../views/houtai/Imginfo.vue'
import Area from '../views/houtai/Areainfo.vue'
import Furniture from '../views/houtai/Furniture.vue'
import ClientInfo from '../views/houtai/ClientInfo.vue'
import Houserinfo from '../views/houtai/Houserinfo.vue'
import Chome from '../views/qiantai/Chome.vue'
import Index from '../views/qiantai/index.vue'
import Clogin from '../views/qiantai/Clogin.vue'
import My from '../views/qiantai/My.vue'
import Xiangqing from '../views/qiantai/Xiangqing.vue'
import GeRen from '../views/qiantai/GeRen.vue'
import HouserFabu from '../views/qiantai/HouserFabu.vue'
import HouserImg from '../views/qiantai/HouserImg.vue'
Vue.use(VueRouter)

const routes = [
  // 前台
  {
    path: '/',component: Chome,
    children:[
      {path: '/',component: Index},
      {path: '/index',name:Index,component: Index},
      {path: '/my',name:'My',component: My ,
        children:[
        { path: '/',  component: GeRen },
        {path: '/geren',name:'GeRen',component: GeRen},
        {path: '/hfb',name:'HouserFabu',component: HouserFabu},
        {path: '/himg',name:'HouserImg',component: HouserImg},
        ]},
      {path: '/xq',name:'Xiangqing',component: Xiangqing,},
    ]
  },
  //登录和注册
  // { path: '/', component: Login},
  {path: '/login',name: 'Login',component: Login},
  {path: '/reg',name: 'Register',component: Register},
  {path: '/clogin',name: 'Calogin', component: Clogin},
  //后台
  {
    path: '/home',
    component: Home,
    children:[
      { path: '/users', component: Users },
      { path: '/img', component: Img },
      { path: '/area', component: Area },
      { path: '/furniture', component: Furniture },
      { path: '/client', component: ClientInfo },
      { path: '/houser', component: Houserinfo }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
